package Sort;



public class Test {
	@org.junit.Test
	public void TestBubbleSort() {
		BubbleSort bubbleSort = new BubbleSort();
		//int[] a = {9,8,7,6,5,4,3,2,1,0};
		int[] a = {9,8,3,4,7,6,5,2,1,0};
		bubbleSort.sortAsc(a);
		//int[] a = {0,1,2,3,4,5,6,7,8,9};
		//bubbleSort.sortDsc(a);
		//a = InsertSort.insertSortDes(a);
		//MergeSort.mergeSort(a);
		//QuickSort.quickSort(a, 0, a.length-1);
		for(int i = 0;i<a.length;i++){
			
			System.out.print(a[i]+"--");
		}
	}
	@org.junit.Test
	public void TestHeapSort() {
		int[] a = {9,8,3,4,7,6,5,2,1,0};
		//HeapSort.maxHeapSort(a);
		HeapSort.minHeapSort(a);
	}
	@org.junit.Test
	public void CountSort(){
		int[] b = {0,1,9,2,3,6,5,0,7,4,0,8};
		int[] outputArray = CountSort.countSort(b, 9);
		for(int i=1; i<outputArray.length;i++){
			
			System.out.print("-"+outputArray[i]);
		}
	}
	@org.junit.Test
	public void TestSelectionProblem(){
		int[] b = {0,1,2,3,9,6,5,8};
		SelectionProblem selectionProblem = new SelectionProblem();
		selectionProblem.SelectionProblem(3, b);
		
	}
	
@org.junit.Test
    public void TestMaxSubSum(){
    	//int[] a = {4,-3,5,-2,-1,2,6,-2};
	    int[] a = {13,-3,-25,20,-3,-16,-23,18,20,-7,12,-5,-22,15,-4,7};
    	//int result = MaxSubSum.maxSubSumRec2(a, 0, a.length-1);
    	//int result = MaxSubSum.maxSubSum3(a);
    	//int[] result = MaxSubSum.maxSubSumRec2(a, 0, a.length-1);
	    int[] result = MaxSubSum.maxSubSum4(a);
    	System.out.println(result[0]+"--");
    	System.out.println(result[1]+"--");
    	System.out.println(result[2]+"--");
    }
	@org.junit.Test
	public void TestBinarySearch(){
		Integer[] a = {0,1,2,3,4,5,6,7,8,9,10};
		int result = BinarySearch.binarySearch(a, new Integer(9));
		System.out.println(result);
	}
	@org.junit.Test
	public void TestGCD(){
		System.out.println(GCD.gcd(50, 15));
	}
}